package OOday03;

import day02.Work;

public class InterFaceDemo {
    public static void main(String[] args) {
        Teacher wang=new Teacher("时伟",33);
        wang.Eat();
        wang.Play();
        wang.Work();
        wang.Drink();
        Doctor li=new Doctor("白求恩",18);
        li.Eat();
        li.Play();
        li.Work();
        li.Drink();
        li.Study();
    }
}
abstract class  Man {
    String name;
    int age;
    abstract void Eat();
    Man(String name,int age){
        this.name=name;
        this.age=age;
    }
    void Drink(){
        System.out.println(name+"正在喝水...");
    }
}
interface Inter{
    void Play();
}
interface Inter1 extends Inter{
    void Work();
}
interface Inter2 extends Inter1 {
    void Study();
}
class Teacher extends Man implements Inter1{
    Teacher(String name,int age){
        super(name,age);
    }
    public void Play(){
        System.out.println(name+"老师正在和学生玩...");
    }
    public void Work(){
        System.out.println(age+"岁的"+name+"老师正在讲课...");
    }
    void Eat(){
        System.out.println(name+"老师正在吃面包...");
    }
}
class Doctor extends Man implements Inter2{
    Doctor(String name,int age){
        super(name,age);
    }
    public void Play() {
    }
    public void Work(){
        System.out.println(age+"岁的"+name+"医生正在做手术...");
    }
    public void Study(){
        System.out.println(age+"岁的"+name+"医生正在学习医术...");
    }
    void Eat(){
        System.out.println(name+"医生正在吃奥利给！");
    }
}